package com.test.webchat.Controller;

import com.test.webchat.Pojo.Response.MessageSessionResponse;
import com.test.webchat.Service.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("session")
@RestController
public class SessionController {
    @Autowired
    private SessionService sessionService;
    // 获取会话列表
    @RequestMapping("/getSessionList")
    public List<MessageSessionResponse> getSessionList(Integer userId) {
        return sessionService.getSessionList(userId);
    }

    @RequestMapping("/addSession")
    public Integer addSession(Integer toUserId,Integer userId){
        return sessionService.addSession(toUserId,userId);
    }
}
